import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import Login from '@/components/Login'
// import Notfound from '@/components/Notfound'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path:'/',
      redirect:'/login',
      hidden:true
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
      hidden:true,
    },
    
    {
      path: '*',
      name: 'Notfound',
      component: ()=>import('@/components/Notfound'),
      hidden:true
    },
    {
      path: '/home',
      redirect:'/home/student',
      name: '学生管理',
      component: Home,
      //设置动态图标
      iconClass:'el-icon-menu',
      children:[
        {
          path: '/home/student',
          name:'学生列表',
          iconClass:'el-icon-notebook-1',
          component: ()=>import('@/components/students/studentList')
        },
        {
          path: '/home/info',
          name:'信息列表',
          iconClass:'el-icon-postcard',
          component: ()=>import('@/components/students/infoList')
        },
        {
          path: '/home/work',
          name:'作业列表',
          iconClass:'el-icon-document',
          component: ()=>import('@/components/students/workList')
        },
        {
          path: '/home/map',
          name:'地址',
          iconClass:'el-icon-delete-location',
          component: ()=>import('@/components/students/map')
        },
        {
          path: '/home/echart',
          name:'数据概览',
          iconClass:'el-icon-s-data',
          component: ()=>import('@/components/students/echart')
        },
      ]
    },  
  ],
  mode:'history'
})
